<?php
namespace app\admin\controller;

use app\BaseController;
use think\facade\Db;
use think\facade\Request;
use think\facade\View;
use think\facade\Session;

class Index extends BaseController
{
    public function index()
    {
        //echo "<pre/>";

        Session::set("wsk","123");var_dump(Session::get("wsk"));
      $user=Db::name("donation")->json(['create_img_data'])->where(["id"=>9])->find();
     // $user=Db::name("donation")->json(['create_img_data'])->where(["id"=>9])->save(["create_img_data->img_url"=>"789.png"]);var_dump($user);exit();
    //  $user=Db::name("donation")->json(['create_img_data'])->where(["id"=>9])->save(["create_img_data"=>[["img_url"=>"123.png"],["img_url"=>"456.png"]]]);var_dump(Db::name("donation")->getLastSql());exit();
        //return View::fetch('index');
        return view('index',["user"=>$user]);
    }

    public function hello($name = 'ThinkPHP6')
    {
        return 'hello,' . $name;
    }
    public function from(){
        $token=$this->request->checkToken("__token__");
        $request1=Request::param();


        var_dump($request1);
        var_dump($token);

    }
    public function ajax()
    {
        $token=$this->request->checkToken("__token__");
        return json($token);
    }
}
